package com.buding.fx.common.constant;

import lombok.Data;

import java.awt.*;

/**
 * @ClassName CodeFormatMainSize
 * @Description TODO
 * @Author mingdw
 * @Date 2024/4/3 8:58
 * @Version 1.0
 */
@Data
public class CodeFormatMainSize {

    private double  wight_percent = 0.6d;

    private  double HEIGHT = 800; //整体高

    private  double WIGTH = 500;

    private static  CodeFormatMainSize  instance;

    public  static  CodeFormatMainSize getInstance(){
        if (instance==null){
            instance = new CodeFormatMainSize();
            instance.initSize();
        }
        return instance;
    }

    private void initSize(){
        GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
        this.WIGTH = gd.getDisplayMode().getWidth()*wight_percent; //获取到绝对宽度
        this.HEIGHT = gd.getDisplayMode().getHeight()*wight_percent; // 获取到绝对高度*/
    }


}
